package main

import (
	"log"
	"net"

	pb "ihos/ihos"

	"google.golang.org/grpc"
)

const (
	// port = ":60051"
	port = ":50051"
)

const (
	sdkappid = 1400289213
	key      = "5998e64bc2338f0284dedd694a92cb6b9a67543d12a95e7da95ca73a47e45acb"
)

// server is used to implement helloworld.GreeterServer.
type server struct {
	pb.UnimplementedHospitalServer
}

func main() {
	log.Println("Server start")
	UserStatInit()
	DBInit()
	lis, err := net.Listen("tcp", port)
	if err != nil {
		log.Fatalf("failed to listen: %v", err)
	}
	s := grpc.NewServer()
	hs := &server{}
	HouZhenPaiDuiInit()
	pb.RegisterHospitalServer(s, hs)
	if err := s.Serve(lis); err != nil {
		log.Fatalf("failed to serve: %v", err)
	}
}
